home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 001-025 / scopedisk15 / snoop / pmsn.doc < prev    next >
Text File  |  1995-03-18  |  3KB  |  78 lines

  1. *****************************************************************
  2. *                                                               *
  3. *                       Poor Man's Snoop                        *
  4. *                                                               *
  5. *             Copyright 1988 by Martin J Laubach                *
  6. *                     All rights reserved                       *
  7. *                                                               *
  8. *****************************************************************
  9.  
  10. This program is inspired by the snoop command of the developers
  11. toolkit disk.  As it's "bigger brother" it helps to trace the
  12. memory allocations made -- only that it writes its output not on
  13. the serial line at 9600 Bd, but to the standard output stream
  14. (therefore the name "poor man's" -- for people without a 9k6
  15. terminal standing around (like me)).
  16.  
  17. To use it, just call it by typing "pmsn" at the cli prompt (or,
  18. even better "run pmsn").  Warning:  you should not use it with
  19. the popular metacomco shell, since the shell makes a lot of small
  20. allocations (for the command history), which make it very hard to
  21. trace what's really going on.  So you'd better start a NewCli,
  22. and run it there.  Also, you should take care to redirect the
  23. output to a file, since some 20k of data aren't unusual.  PMSN
  24. stays dormant in the background, recording all the memory
  25. allocation/deallocation calls to AllocMem() and FreeMem(), until
  26. you hold the left mousebutton about 3 seconds down - of a mouse
  27. connected to the second gameport (a joystick firebutton will do).
  28. Then all the accumulated data is dumped to the standard output
  29. stream.
  30.  
  31.  
  32.  
  33. The format of the dump is really straightforward and quite easy
  34. to understand:
  35.  
  36.    AllocMem( 00000100, 00010001) = 00200090  [00209000] [000000198]
  37.       |         |          |           |         |             |
  38.       |         |          |           |       (a7)           4(a7)
  39.       |         |          |           |
  40.       |         |          |  Result returned by AllocMem
  41.       |         |  second argument (MEMF_CLEAR|MEMF_PUBLIC)
  42.       |   first argument (256 bytes to allocate)
  43. function called
  44.  
  45.  
  46.    FreeMem ( 00200000, 00000010)              [00202020] [00202021]
  47.       |         |          |                      |             |
  48.       |         |          |                    (a7)           4(a7)
  49.       |         |          |
  50.       |         |  second argument (16 bytes to free)
  51.       |  first argument (address of block to be freed)
  52. function called
  53.  
  54.  
  55. Each line contains the function name, the arguments for this
  56. function, the result (if any), as well as the first two longs on
  57. the stack (these are included to find out where the call came
  58. from -- an address in the 00fxxxxx usally means the function was
  59. called by the OS).
  60.  
  61. Hope it'll help you,
  62. ---mjl
  63.  
  64. PS: Comments are *very* welcome. Mail me at mjl@alison.uucp or
  65.     uunet!tuvie!alison!mjl.SHAR_EOF
  66.  test 2913 -ne "`wc -c pmsn.doc`"
  67. en
  68. ho shar: error transmitting pmsn.doc '(should have been 2913 characters)'
  69.  
  70. End of shell archive
  71. it 0
  72. it 0
  73. it 0
  74.   //    mjl    The first rule of intelligent tinkering
  75. \X/    ---        is to save all the parts.
  76.                     PAUL ERLICH
  77.                     PAUL ERLICH
  78.